import request from '@/utils/request'
// 1.工单状态列表的下拉框
export const allTaskStatus = () => {
  return request({
    url: '/task-service/task/allTaskStatus'
  })
}
// 1.2.工单配置工单类型
export const taskType = () => {
  return request({
    url: '/task-service/taskType/list'
  })
}
// 2.运营工单列表表格
export const taskSearch = (params) => {
  return request({
    url: '/task-service/task/search',
    params
  })
}
// 3.工单配置--获取补货预警线
export const getsupplyAlertValue = () => {
  return request({
    url: '/task-service/task/supplyAlertValue'
  })
}
// 4.工单配置-确定--设置自动补货工单阈值
export const postautoSupplyConfig = (alertValue) => {
  return request({
    url: '/task-service/task/autoSupplyConfig',
    method: 'post',
    data: {
      alertValue: alertValue
    }
  })
}
// 5.新增表单--获取运营人员的下拉数据--根据售货机获取运营人员列表
export const getoperatorList = (innerCode) => {
  return request({
    url: `/user-service/user/operatorList/${innerCode}`
  })
}
// 6.根据输入设备编号--获取补货清单列表
export const getchannelList = (innerCode) => {
  return request({
    url: `/vm-service/channel/channelList/${innerCode}`
  })
}
// 7.新增工单配置
export const PostCreate = (data) => {
  return request({
    url: '/task-service/task/create',
    method: 'post',
    data
  })
}
// 8.查看详情里面的工单详情
// Path： /api/task-service/task/taskInfo/:taskId
export const taskInfo = (taskId) => {
  return request({
    url: `/task-service/task/taskInfo/${taskId}`
  })
}
// 9.表格查看详情--里面的补货详情
export const gettaskDetails = (taskId) => {
  return request({
    url: `task-service/taskDetails/${taskId}`
  })
}
// 10.表格查看详情--取消工单
export const postCancel = (data) => {
  return request({
    url: `/task-service/task/cancel/${data.taskId}`,
    method: 'post',
    data
  })
}

// 11.运维工单-新增表单的运维人员下拉数据
export const getrepairerList = (innerCode) => {
  return request({
    url: `/user-service/user/repairerList/${innerCode}`
  })
}
